/*! 
 * Header file for the rigid body descriptor structure.
 *
 * \author Devis Rossini
 * \date 15 April 2012
 */ 
#ifndef PHXRIGIDBODYDESCRIPTOR_H_INCLUDE_GUARD
#define PHXRIGIDBODYDESCRIPTOR_H_INCLUDE_GUARD

#include "PhxCore.h"

namespace phx
{
	/*! 
	 * Types of rigid body: dynamic, static, kinematic (coming soon :D), etc.
	 */
	typedef enum RigidBodyTypes
	{
		DYNAMIC_BODY,
		STATIC_BODY
	} RigidBodyTypes;

	struct RigidBodyDescriptor
	{
		RigidBodyDescriptor()
			: mMass(0)
			, mLinearDamping(real(0.99))
			, mAngularDamping(real(0.99))
			, mIsAwake(true)
			, mCanSleep(true) { }

		#pragma region Characteristic data

		/*!
		 * Mass of the rigid body.
		 *
		 * \note If the specified mass is 0, the body will be
		 * considered static.
		 */
		real mMass;

		/*!
		 * Intertia tensor of the body.
		 */
		Matrix3 mInertiaTensor;

		/*!
         * Linear damping value.
         */
        real mLinearDamping;

		/*!
         * Angular damping value.
         */
        real mAngularDamping;

		#pragma endregion	

		#pragma region Kinematic state
	
		/*!
         * Initial position.
         */
        Vector3 mPosition;

		/*!
         * Initial orientation.
         */
        Quaternion mOrientation;

		/*!
         * Initial (linear) velocity.
         */
        Vector3 mVelocity;

		/*!
         * Initial angular velocity.
         */
        Vector3 mAngularVelocity;

		/*!
         * Constant acceleration of the body.
         */
		Vector3 mAcceleration;

		#pragma endregion

		#pragma region Sleep properties

		/*!
         * A body can be put to sleep to avoid it being updated
         * by the integration functions or affected by collisions
         * with the world.
         */
        bool mIsAwake;

		/*!
         * Some bodies should be always awake.
         */
        bool mCanSleep;

		#pragma endregion
	};
}

#endif // PHXRIGIDBODYDESCRIPTOR_H_INCLUDE_GUARD